package com.example.springevent.listener;

import com.example.springevent.event.PayloadEvent;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.event.EventListener;
import org.springframework.stereotype.Component;

/**
 * Payload事件监听器 - 处理不继承ApplicationEvent的事件
 */
@Slf4j
@Component
public class PayloadEventListener {
    
    @EventListener
    public void handlePayloadEvent(PayloadEvent event) {
        log.info("收到Payload事件: 名称 = {}, 内容 = {}, 时间戳 = {}", 
                event.getEventName(), 
                event.getPayload(),
                event.getTimestamp());
    }
}